/***********************************************************************
 * Module:  LicencePlateKindController.java
 * Author:  Administrator
 * Purpose: Defines the Class LicencePlateKindController
 ***********************************************************************/

package ishitong.vehicleManagement.controller;

import ishitong.common.SysCodeType;
import ishitong.common.model.SysCode;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/** @pdOid c29d11c9-2d39-4b55-833f-7340a5398674 */
@Controller
public class LicencePlateKindController extends ishitong.common.controller.ActionController {
   /** @pdOid fbe3c679-84df-4258-8ebf-c18976984053 */
   private static final String LPK_SLT_DLG = "vehicleManagement/licencePlateKind/licencePlateKindSelectDialog";
   /** @pdOid d2384211-ca8d-4905-8ed4-f5b32df0e2d6 */
   private static final String LPK_SLT_LST = "vehicleManagement/licencePlateKind/licencePlateKindSelectList";
   
   /** @param request
    * @pdOid 837d15dc-1569-40e4-be95-0e5635291423 */
   @RequestMapping(value = "/ajaxShowLicencePlateKindSelectDialog.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxShowLicencePlateKindSelectDialog(HttpServletRequest request) {
   	return new ModelAndView(LPK_SLT_DLG);
   }
   
   /** @param request 
    * @param sysCode
    * @pdOid 792491d6-d65e-44fc-a272-0165d4d59138 */
   @RequestMapping(value = "/ajaxFindLicencePlateKindSelectList.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxFindLicencePlateKindSelectList(HttpServletRequest request, SysCode sysCode) {
   	try {
   		Map<String, Object> model = new HashMap<>();
   		List<SysCode> listLicencePlateKind = spiSysCodeService.getSysCodeListByTypeCodeAndCondition(SysCodeType.PLATE_KIND,sysCode);
   		model.put("listLicencePlateKind", listLicencePlateKind);
   		return new ModelAndView(LPK_SLT_LST, model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }

}